import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';

import 'index.dart';

class SplashPage extends GetView<SplashController> {
  const SplashPage({Key? key}) : super(key: key);

  // 主视图
  Widget _buildView() {
    return Center(
      child: Column(
        mainAxisAlignment: MainAxisAlignment.center,
        children: [
          // 启动页 logo
          Image.asset(
            'assets/images/logo1.png',
            fit: BoxFit.contain,
            // 可添加宽高约束，避免图片过大/过小
            width: 200.w,
            height: 200.w,
          ),
          SizedBox(height: 30.h),
          // 加载指示器（注意：白色指示器在白色背景上可能看不见，建议修改颜色）
          // CircularProgressIndicator(
          //   valueColor: AlwaysStoppedAnimation<Color>(Colors.blue), // 示例：改为蓝色
          //   strokeWidth: 3.w,
          // ),
        ],
      ),
    );
  }

  @override
  Widget build(BuildContext context) {
    return GetBuilder<SplashController>(
      builder: (_) {
        return Scaffold(
          // appBar: AppBar(title: const Text("splash")),
          body: SafeArea(child: _buildView()),
        );
      },
    );
  }
}
